package com.hhkj.study.admin.user.service.base;

import com.hhkj.study.admin.user.entity.UserListen;
import com.hhkj.study.admin.user.entity.UserListenGroupPo;
import com.hhkj.study.admin.user.model.podo.*;
import com.hhkj.study.admin.user.model.res.UserStatisticExcelRes;
import com.ruoyi.common.base.biz.service.base.BaseService;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
*
* @author SERVER
* @since 2024-09-06
*/
public interface UserListenService extends BaseService<UserListen, UserListenDo, UserListenPo> {

    /**
     * 根据用户、课程、订单、类型查询学习记录
     * @param userId
     * @param courseId
     * @param orderItemId
     * @param type
     * @return
     */
    List<UserListen> listByUserCourse(Long userId, Long courseId, Long orderItemId, Long type, Collection<Long> videoIdList);


    /**
     * 用户查询订单下的听课记录 分组查询
     * @param userId
     * @param orderItemIdList
     * @return
     */
    List<UserListenGroupPo> listGroupByOrderItem(Long userId, List<Long> orderItemIdList, Integer listeningStatus);

    /**
     * 订单id 课程id查询单个用户学习情况
     * @param userStatisticDo
     * @return
     */
    List<UserStatisticPo> countUserStudyByCondition(UserStatisticDo userStatisticDo);

    /**
     * 所有用户学习情况
     * @param userStatisticExportDo
     * @return
     */
    List<UserStatisticExcelRes> countUserStudyDetail(UserStatisticExportDo userStatisticExportDo);
}